import request from '../utils/request'

/**
 * 获取房屋的数据
 */
export const getHouseList = (cityId) => {
  return request('/houses', {
    params: {
      cityId,
    },
  })
}

/**
 * 获取房屋查询条件
 * @param {*} cityId
 * @returns
 */
export const getHouseCondition = (id) => {
  return request('/houses/condition', {
    params: {
      id,
    },
  })
}
/**
 * 根据筛选条件获取房屋数据
 * @param {*} params
 * @returns
 */
export const SearchHouseList = (params) => {
  return request('/houses', {
    params,
  })
}

/**
 * 查询房屋具体信息
 * @param {*} id
 * @returns
 */
export const getHouseDeatil = (id) => {
  return request('/houses/' + id)
}

/**
 * 上传图片
 * @param {*} form
 */
export const uploadImg = (formData) => {
  return request.post('/houses/image', formData, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  })
}
